package com.liu.design.structure.adapte.inter;

/**
 * @author LIU
 * @version 1.0
 * @date 2024/5/6 11:12
 * @description 子类可有选择地覆盖父类的某些方法来实现需求
 */
public  class PowerAdapter extends AbsAdapter {
    private AC220V ac220V;

    public PowerAdapter(AC220V ac220V) {
        this.ac220V = ac220V;
    }

    @Override
    public int outputDC5V() {
        int adapterIn = ac220V.output220V();
        int adapterOut = adapterIn / 44;
        System.out.println("使用 adapter 输入 AC" +adapterIn + "V，输出 DC" + adapterOut +"V" );
        return adapterOut;
    }


}
